﻿using System;
using System.Web;

namespace Idunno.AntiCsrf.SampleWeb
{
    [Idunno.AntiCsrf.SuppressCsrfCheck]
    public partial class unprotectedPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies != null)
            {
                HttpCookie csrfCookie;
                if (Request.Cookies[Configuration.CsrfSettings.Settings.CookieName] != null)
                {
                    csrfCookie = Request.Cookies[Configuration.CsrfSettings.Settings.CookieName];
                    if (csrfCookie != null)
                    {
                        this.theCookie.Text = csrfCookie.Value;
                    }
                }
            }
            this.callingMethod.Text = Request.HttpMethod;
        }

        protected void submit_Click(object sender, EventArgs e)
        {
            // Presumably we're going off to the database here to do something...
            Label1.Text = TextBox1.Text;
        }
    }
}
